package com.zeyu.framework.tools.console.entity;

/**
 * VNC 协议参数配置类
 * Created by zeyuphoenix on 16/10/17.
 */
public class VNCConfiguration extends BasicConfiguration {

    // ================================================================
    // Constants
    // ================================================================

    // ================================================================
    // Fields
    // ================================================================

    // Network parameters
    /**
     * The port the VNC server is listening on, usually 5900 or 5900 + display number.
     */
    private int port = 5900;
    /**
     * The number of times to retry connecting before giving up and returning an error.
     * In the case of a reverse connection, this is the number of times the connection process is allowed to time out.
     */
    private int autoretry = -1;

    // Authentication
    /**
     * The password to use when attempting authentication, if any. This parameter is optional.
     */
    private String password;

    // Display settings
    /**
     * The color depth to request, in bits-per-pixel. This parameter is optional.
     * If specified, this must be either 8, 16, 24, or 32. Regardless of what value is chosen here,
     * if a particular update uses less than 256 colors, Guacamole will always send that update as a 256-color PNG.
     */
    private int color_depth;
    /**
     * If the colors of your display appear wrong (blues appear orange or red, etc.),
     * it may be that your VNC server is sending image data incorrectly, and the red and blue components of each color
     * are swapped. If this is the case, set this parameter to "true" to work around the problem.
     * This parameter is optional.
     */
    private boolean swap_red_blue = false;
    /**
     * If set to "remote", the mouse pointer will be rendered remotely,
     * and the local position of the mouse pointer will be indicated by a small dot.
     * A remote mouse cursor will feel slower than a local cursor, but may be necessary
     * if the VNC server does not support sending the cursor image to the client.
     *
     * remote local
     */
    private String cursor;
    /**
     * A space-delimited list of VNC encodings to use. The format of this parameter is dictated
     * by libvncclient and thus doesn't really follow the form of other Guacamole parameters.
     * This parameter is optional, and libguac-client-vnc will use any supported encoding by default.
     */
    private String encodings;
    /**
     * Whether this connection should be read-only. If set to "true", no input will be accepted
     * on the connection at all. Users will only see the desktop and whatever other users
     * using that same desktop are doing. This parameter is optional.
     */
    private boolean read_only = false;

    // File transfer (via SFTP)
    // VNC does not normally support file transfer, but Console can provide file transfer over SFTP even
    // when the remote desktop is otherwise being accessed through VNC and not SSH.
    /**
     * Whether file transfer should be enabled. If set to "true", the user will be allowed to
     * upload or download files from the specified server using SFTP. If omitted, SFTP will be disabled.
     */
    private boolean enable_sftp = false;
    /**
     * The hostname or IP address of the server hosting SFTP. This parameter is optional.
     * If omitted, the hostname of the VNC server specified with the hostname parameter will be used.
     */
    private String sftp_hostname;
    /**
     * The port the SSH server providing SFTP is listening on, usually 22. This parameter is optional.
     * If omitted, the standard port of 22 will be used.
     */
    private int sftp_port = 22;
    /**
     * The username to authenticate as when connecting to the specified SSH server for SFTP.
     * This parameter is required.
     */
    private String sftp_username;
    /**
     * The password to use when authenticating with the specified SSH server for SFTP.
     */
    private String sftp_password;
    /**
     * The entire contents of the private key to use for public key authentication.
     * If this parameter is not specified, public key authentication will not be used.
     * The private key must be in OpenSSH format, as would be generated by the OpenSSH ssh-keygen utility.
     */
    private String sftp_private_key;
    /**
     * The passphrase to use to decrypt the private key for use in public key authentication.
     * This parameter is not needed if the private key does not require a passphrase.
     */
    private String sftp_passphrase;
    /**
     * The directory to upload files to if they are simply dragged and dropped, and thus otherwise lack
     * a specific upload location. This parameter is optional. If omitted, the default upload location of
     * the SSH server providing SFTP will be used.
     */
    private String sftp_directory;

    // VNC Repeater
    /**
     * The destination host to request when connecting to a VNC proxy such as UltraVNC Repeater.
     */
    private String dest_host;
    /**
     * The destination port to request when connecting to a VNC proxy such as UltraVNC Repeater.
     */
    private String dest_port;

    // Clipboard encoding
    /**
     * The encoding to assume for the VNC clipboard. This parameter is optionl.
     * By default, the standard encoding ISO 8859-1 will be used.
     * Only use this parameter if you are sure your VNC server supports other encodings beyond the standard ISO 8859-1.
     *
     * ISO8859-1  UTF-8  UTF-16  CP1252
     */
    private String clipboard_encoding;

    /**
     * audio support will be enabled, and a second connection for PulseAudio will be made in addition to the VNC connection
     */
    private boolean enable_audio = false;

    /**
     * The name of the PulseAudio server to connect to.
     */
    private String audio_servername;

    // ================================================================
    // Constructors
    // ================================================================

    // ================================================================
    // Methods from/for super Interfaces or SuperClass
    // ================================================================

    @Override
    public String getProtocol() {
        return ConsoleParam.TYPE_VNC;
    }

    // ================================================================
    // Public or Protected Methods
    // ================================================================

    // ================================================================
    // Getter & Setter
    // ================================================================

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getAutoretry() {
        return autoretry;
    }

    public void setAutoretry(int autoretry) {
        this.autoretry = autoretry;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getColor_depth() {
        return color_depth;
    }

    public void setColor_depth(int color_depth) {
        this.color_depth = color_depth;
    }

    public boolean isSwap_red_blue() {
        return swap_red_blue;
    }

    public void setSwap_red_blue(boolean swap_red_blue) {
        this.swap_red_blue = swap_red_blue;
    }

    public String getCursor() {
        return cursor;
    }

    public void setCursor(String cursor) {
        this.cursor = cursor;
    }

    public String getEncodings() {
        return encodings;
    }

    public void setEncodings(String encodings) {
        this.encodings = encodings;
    }

    public boolean isRead_only() {
        return read_only;
    }

    public void setRead_only(boolean read_only) {
        this.read_only = read_only;
    }

    public boolean isEnable_sftp() {
        return enable_sftp;
    }

    public void setEnable_sftp(boolean enable_sftp) {
        this.enable_sftp = enable_sftp;
    }

    public String getSftp_hostname() {
        return sftp_hostname;
    }

    public void setSftp_hostname(String sftp_hostname) {
        this.sftp_hostname = sftp_hostname;
    }

    public int getSftp_port() {
        return sftp_port;
    }

    public void setSftp_port(int sftp_port) {
        this.sftp_port = sftp_port;
    }

    public String getSftp_username() {
        return sftp_username;
    }

    public void setSftp_username(String sftp_username) {
        this.sftp_username = sftp_username;
    }

    public String getSftp_password() {
        return sftp_password;
    }

    public void setSftp_password(String sftp_password) {
        this.sftp_password = sftp_password;
    }

    public String getSftp_private_key() {
        return sftp_private_key;
    }

    public void setSftp_private_key(String sftp_private_key) {
        this.sftp_private_key = sftp_private_key;
    }

    public String getSftp_passphrase() {
        return sftp_passphrase;
    }

    public void setSftp_passphrase(String sftp_passphrase) {
        this.sftp_passphrase = sftp_passphrase;
    }

    public String getSftp_directory() {
        return sftp_directory;
    }

    public void setSftp_directory(String sftp_directory) {
        this.sftp_directory = sftp_directory;
    }

    public String getDest_host() {
        return dest_host;
    }

    public void setDest_host(String dest_host) {
        this.dest_host = dest_host;
    }

    public String getDest_port() {
        return dest_port;
    }

    public void setDest_port(String dest_port) {
        this.dest_port = dest_port;
    }

    public String getClipboard_encoding() {
        return clipboard_encoding;
    }

    public void setClipboard_encoding(String clipboard_encoding) {
        this.clipboard_encoding = clipboard_encoding;
    }

    public boolean isEnable_audio() {
        return enable_audio;
    }

    public void setEnable_audio(boolean enable_audio) {
        this.enable_audio = enable_audio;
    }

    public String getAudio_servername() {
        return audio_servername;
    }

    public void setAudio_servername(String audio_servername) {
        this.audio_servername = audio_servername;
    }

// ================================================================
    // Private Methods
    // ================================================================

    // ================================================================
    // Inner or Anonymous Class
    // ================================================================

    // ================================================================
    // Test Methods
    // ================================================================

}
